

import { useState } from "react";
import { getData } from "../Data"
import { useMount, useReactive } from "ahooks";
import { FlexGrid } from "@grapecity/wijmo.react.grid";
import { Radio } from 'antd'
const WijmoC01 = () => {
    const InitData = useReactive({ init: null })
    const [Data, setData] = useState()
    const onChange = (e) => InitData.init.newRowAtTop = e.target.value
    const init = (e) => { InitData.init = e }
    useMount(() => { setData(getData(20)) })

    if (Data) {
        return (
            <div className='Page'>
                <FlexGrid initialized={init} allowAddNew={true} allowDelete={true} itemsSource={Data} newRowAtTo={false} />
                <Radio.Group defaultValue={false} buttonStyle="solid" onChange={onChange}>
                    <Radio.Button value={true}>头部</Radio.Button>
                    <Radio.Button value={false}>尾部</Radio.Button>
                </Radio.Group>
            </div>
        )
    }
}

export default WijmoC01;